<template>
	<div>
		<!-- 钢种管理 -->
		<pol-title title="钢种管理"></pol-title>
		<div class="padding-lg border-solid bg-tm radius-sm text-white">
			<!-- 搜索框 -->
			<pol-search :form="searchForm" :schema="schema">
				<template #btnSlot>
					<el-button icon="Plus" type="primary" class="btn-bg-blue padding-lr-xl" style="height: 40px; line-height: 40px;" @click="dialogHeatScheduleEdit = true">新增</el-button>
				</template>
			</pol-search>

			<!-- 表格 -->
			<pol-table ref="polTableRef" v-bind="tableOpt" :isPage="true" :isSelection="true" height="500px">
				<template #chongzhi="{row}">
					<div class="flex align-center">
						<span class="text-green2 cursor">编辑</span>
						<span class="text-green2 cursor margin-left-lg">删除</span>
					</div>
				</template>

				<template #pageLeft>
					<div class="margin-right-xxl">
						<el-button icon="Upload" type="primary" class="btn-bg-blue btn-box padding-lr-xl" style="height: 40px; line-height: 40px;">导出</el-button>
					</div>
				</template>
			</pol-table>
		</div>

		<pol-title title="Q235成分列表" class="margin-top-lg"></pol-title>
		<div class="padding-lg border-solid bg-tm radius-sm text-white">
			<!-- 表格 -->
			<pol-table ref="polTableRef2" v-bind="tableOpt2" height="300px"></pol-table>
		</div>
		
		<!-- 弹窗 -->
		<el-dialog v-model="dialogHeatScheduleEdit" title="新增钢种" width="1100" center align-center>
			<div class="padding search-light">
				<lay-json-schema-form :model="formData" :schema="schema2"></lay-json-schema-form>
				<div class="margin-top-xl flex justify-center align-center">
					<el-button class="padding-lr-xl text-blue3 solid-blue" size="large" @click="dialogHeatScheduleEdit = false">返回</el-button>
					<div class="margin-left-xxl">
						<el-button type="primary" class="btn-bg-blue btn-box padding-lr-xl" size="large">保存</el-button>
					</div>
				</div>
			</div>
		</el-dialog>
	</div>
</template>

<script setup>
	import { ref } from 'vue';
	
	const dialogHeatScheduleEdit = ref(false)
	
	//表单数据
	const formData = ref({
		CardTypeCode: '', //
		CardTypeName: '', //
	});
	
	//表单配置
	const schema2 = ref({
		CardTypeCode: {
			label: '断面名称：',
			type: 'input',
			props: {
				type: 'text',
				placeholder: '请输入断面名称',
			},
			colProps: {
				md: 24,
			},
		},
		CardTypeName: {
			label: '启用状态：',
			type: 'input',
			props: {
				type: 'text',
				placeholder: '请输入启用状态',
			},
			colProps: {
				md: 24,
			},
		},
		CardTypeName3: {
			label: '断面参数1：',
			type: 'input',
			props: {
				type: 'text',
				placeholder: '请输入断面参数1',
			},
			colProps: {
				md: 24,
			},
		},
		CardTypeName4: {
			label: '断面参数2：',
			type: 'input',
			props: {
				type: 'text',
				placeholder: '请输入断面参数2',
			},
			colProps: {
				md: 24,
			},
		},
		CardTypeName5: {
			label: '断面参数3：',
			type: 'input',
			props: {
				type: 'text',
				placeholder: '断面参数3',
			},
			colProps: {
				md: 24,
			},
		},
	
		adTypeCode: {
			label: '断面参数4：',
			type: 'input',
			props: {
				type: 'text',
				placeholder: '请输入断面参数4',
			},
			colProps: {
				md: 24,
			},
		},
		adTypeName: {
			label: '断面参数5：',
			type: 'input',
			props: {
				type: 'text',
				placeholder: '请输入断面参数5',
			},
			colProps: {
				md: 24,
			},
		},
	});
	
	//搜素数据
	const searchForm = ref({
		CardTypeCode: '', //
		CardTypeName: '', //
	});

	//搜素配置
	const schema = ref({
		CardTypeCode: {
			label: '钢类',
			type: 'select',
			props: {
				showSearch: true, //开启搜索
				allowClear: true, //是否允许清空
				options: [{
					label: '全部',
					value: '全部',
				}],
				placeholder: '选择钢类',
			},
			colProps: {
				md: 6,
			},
		},
		CardTypeName: {
			label: '关键字',
			type: 'input',
			props: {
				type: 'text',
				placeholder: '选择输入关键字搜索',
			},
			colProps: {
				md: 6,
			},
		}
	});

	const polTableRef = ref(null); //表格ref
	//表格配置
	const columns = ref([
		{ label: '钢种名称', key: 'ItemCode', align: 'center' },
		{ label: '钢类', key: 'ItemName', align: 'center' },
		{ label: '启用状态', key: 'ItemValue', align: 'center' },
		{ label: '密度', key: 'IsDefault', align: 'center' },
		{ label: '固相线', key: 'P_IsSys', align: 'center' },
		{ label: '液相线', key: 'P_IsReadOnly', align: 'center' },
		{ label: '中包温度范围', key: 'gangbao', align: 'center' },
		{ label: '拉速范围', key: 'kaishi', align: 'center' },
		{ label: '操作', key: 'chongzhi', align: 'center', slot: true, width: '130px' },
	]);

	//表格配置
	const tableOpt = ref({
		columns: columns.value,
		localData: [{
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			},
			{
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			}, {
				ItemCode: 'Q195',
				ItemName: '锻钢',
				ItemValue: '启用',
				IsDefault: '7.85',
				P_IsSys: '1400-1450',
				P_IsReadOnly: '1600',
				gangbao: '1520-1560',
				kaishi: '1.0-4.0',
			},
		]
	});

	//表格配置
	const columns2 = ref([
		{ label: '元素', key: 'ItemCode', align: 'center' },
		{ label: 'C', key: 'ItemName', align: 'center' },
		{ label: 'Si', key: 'ItemValue', align: 'center' },
		{ label: 'Mn', key: 'IsDefault', align: 'center' },
		{ label: 'P', key: 'P_IsSys', align: 'center' },
		{ label: 'S', key: 'P_IsReadOnly', align: 'center' },
		{ label: 'Cr', key: 'gangbao', align: 'center', width: '250px' },
		{ label: 'Ni', key: 'kaishi', align: 'center' },
		{ label: 'Cu', key: 'chongzhi', align: 'center' },
		{ label: 'Mo', key: 'gangzhong', align: 'center', width: '140px' },
		{ label: 'Ti', key: 'caozhuo', align: 'center', width: '120px' }
	]);

	//表格配置
	const tableOpt2 = ref({
		columns: columns2.value,
		localData: [{
			ItemCode: 'Max',
			ItemName: '0.34',
			ItemValue: '0.34',
			IsDefault: '0.34',
			P_IsSys: '0.34',
			P_IsReadOnly: '0.34',
			gangbao: '0.34',
			kaishi: '0.34',
			chongzhi: '0.34',
			gangzhong: '0.34',
			caozhuo: '0.34'
		}, {
			ItemCode: 'Standard',
			ItemName: '0.34',
			ItemValue: '0.34',
			IsDefault: '0.34',
			P_IsSys: '0.34',
			P_IsReadOnly: '0.34',
			gangbao: '0.34',
			kaishi: '0.34',
			chongzhi: '0.34',
			gangzhong: '0.34',
			caozhuo: '0.34'
		}, {
			ItemCode: 'Min',
			ItemName: '0.34',
			ItemValue: '0.34',
			IsDefault: '0.34',
			P_IsSys: '0.34',
			P_IsReadOnly: '0.34',
			gangbao: '0.34',
			kaishi: '0.34',
			chongzhi: '0.34',
			gangzhong: '0.34',
			caozhuo: '0.34'
		}, ]
	});
</script>

<style lang="scss" scoped>

</style>